/*
buf.length
buf.toString()
buf.fill()
buf.equals()
buf.indexOf()
buf.copy()
 */

var buf = Buffer.from('buf.length')
console.log(buf.length)

buf = Buffer.allocUnsafe(5)
buf[0]=22
console.log(buf.length)

console.log(buf.toString('base64'))
console.log(buf.toString('utf-8'))

const buf3 = Buffer.allocUnsafe(10)

console.log(buf3)
console.log(buf3.fill(10,2,6))

const buf4 = Buffer.from('test')
const buf5 = Buffer.from('test')
const buf6 = Buffer.from('你好啊!')

console.log(buf4.equals(buf5))
console.log(buf4.equals(buf6))

console.log(buf4.indexOf('es'))
console.log(buf4.indexOf('esa'))

/*
10
5
FikQlNU=
)��
<Buffer 81 00 00 00 a9 29 10 94 01 00>
<Buffer 81 00 0a 0a 0a 0a 10 94 01 00>
true
false
1
-1
 */
